/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entityprojet;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author T.Ron
 */
@Entity
@Table(name = "NATURECG")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Naturecg.findAll", query = "SELECT n FROM Naturecg n"),
    @NamedQuery(name = "Naturecg.findByNumnaturecg", query = "SELECT n FROM Naturecg n WHERE n.numnaturecg = :numnaturecg"),
    @NamedQuery(name = "Naturecg.findByIntitulenaturecg", query = "SELECT n FROM Naturecg n WHERE n.intitulenaturecg = :intitulenaturecg"),
    @NamedQuery(name = "Naturecg.findByDe", query = "SELECT n FROM Naturecg n WHERE n.de = :de"),
    @NamedQuery(name = "Naturecg.findByA", query = "SELECT n FROM Naturecg n WHERE n.a = :a")})
public class Naturecg implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "NUMNATURECG")
    private Integer numnaturecg;
    @Basic(optional = false)
    @Column(name = "INTITULENATURECG")
    private String intitulenaturecg;
    @Column(name = "DE")
    private Long de;
    @Column(name = "A")
    private Long a;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "numnaturecg")
    private Collection<Compteg> comptegCollection;

    public Naturecg() {
    }

    public Naturecg(Integer numnaturecg) {
        this.numnaturecg = numnaturecg;
    }

    public Naturecg(Integer numnaturecg, String intitulenaturecg) {
        this.numnaturecg = numnaturecg;
        this.intitulenaturecg = intitulenaturecg;
    }

    public Integer getNumnaturecg() {
        return numnaturecg;
    }

    public void setNumnaturecg(Integer numnaturecg) {
        this.numnaturecg = numnaturecg;
    }

    public String getIntitulenaturecg() {
        return intitulenaturecg;
    }

    public void setIntitulenaturecg(String intitulenaturecg) {
        this.intitulenaturecg = intitulenaturecg;
    }

    public Long getDe() {
        return de;
    }

    public void setDe(Long de) {
        this.de = de;
    }

    public Long getA() {
        return a;
    }

    public void setA(Long a) {
        this.a = a;
    }

    @XmlTransient
    public Collection<Compteg> getComptegCollection() {
        return comptegCollection;
    }

    public void setComptegCollection(Collection<Compteg> comptegCollection) {
        this.comptegCollection = comptegCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numnaturecg != null ? numnaturecg.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Naturecg)) {
            return false;
        }
        Naturecg other = (Naturecg) object;
        if ((this.numnaturecg == null && other.numnaturecg != null) || (this.numnaturecg != null && !this.numnaturecg.equals(other.numnaturecg))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityprojet.Naturecg[ numnaturecg=" + numnaturecg + " ]";
    }
    
}
